import requests


class HttpRequest:
    def __init__(self):
        self.session = requests.session()

    def send_request(self, method, url, data, header=None, app_code=None):
        if method.upper() == "GET":
            if header:
                res = self.session.get(url=url, params=data, headers=header)
            else:
                res=self.session.get(url=url,params=data)
        elif method.upper() == "POST":
            if header:
                res = self.session.post(url=url, params=data, headers=header)
            else:
                res = self.session.post(url=url, params=data)
        return res


if __name__ == '__main__':
    # HR = HttpRequest()
    # HR.send_request()
    pass